package com.xianniu.ltc.enums;

import lombok.Getter;

/**
 * @author wangruijie
 * @version 1.0
 * @description: < 采购订单来源 >
 * @date 2021/5/27 19:32
 */
@Getter
public enum PurchaseOrderSourceEnum {
    // 采购订单来源（采购系统；2微站）
    CG(1,"019-0179b7d713450001"),
    WZ(2,"019-0179b7d727130002");

    private Integer key;
    private String value;

    PurchaseOrderSourceEnum(Integer key, String value){
        this.key=key;
        this.value=value;
    }
    /**
     * 自己定义一个静态方法,通过key返回枚举常量对象
     * @param key
     * @return
     */
    public static PurchaseOrderSourceEnum getValue(Integer key){

        for (PurchaseOrderSourceEnum color: values()) {
            if(color.getKey().equals(key)){
                return  color;
            }
        }
        return null;
    }
}
